package com.csjung.games.gamenori.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class OnMessageEvent extends GwtEvent<OnMessageEvent.Handler> {

  private String message;
  /**
   * Handler for {@link OnMessageEvent}.
   */
  public interface Handler extends EventHandler {
  
    void onMessage(OnMessageEvent event);
  }
  
  public static final Type<OnMessageEvent.Handler> TYPE = new Type<OnMessageEvent.Handler>();
  
  public OnMessageEvent(String message) {
    this.setMessage(message);
  }

  @Override
  public com.google.gwt.event.shared.GwtEvent.Type<Handler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(Handler handler) {
    handler.onMessage(this);
  }

  public String getMessage() {
    return message;
  }

  public void setMessage(String message) {
    this.message = message;
  }
}
